package com.lge.qcontact;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Window;
import android.widget.FrameLayout;

public class IntroActivity extends Activity {

	Handler handler;
	ImageMovingView iView;
	FrameLayout frame;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		iView = new ImageMovingView(this);
		setContentView(R.layout.activity_intro);
		
		frame = (FrameLayout)findViewById(R.id.framLayout);
		frame.addView(iView);
		handler = new Handler();
		handler.postDelayed(irun,5000);//
	}
	

	
	Runnable irun = new Runnable() {
		
		@Override
		public void run() {
			// TODO Auto-generated method stub
			
			Log.i("ddd","bkd");
			iView.setRunThread(false);
			Intent intent = new Intent(IntroActivity.this,MainActivity.class);
			startActivity(intent);
			finish();
			
			overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
		}
	};
	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		super.onBackPressed();
		iView.setRunThread(false);
		handler.removeCallbacks(irun);
		}
	
	
}	


